package com.caozhi.mspeoject.nb_message.service.admin.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.caozhi.mspeoject.nb_message.mapper.MediaMapper;
import com.caozhi.mspeoject.nb_message.service.admin.AdminMediaService;
import com.woniuxy.boot.common.bean.Media;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AdminMediaServiceImpl extends ServiceImpl<MediaMapper , Media> implements AdminMediaService {
    @Autowired
    private MediaMapper mediaMapper;
    @Override
    public List<Media> getMediaByMessageId(Long messageId) {
        LambdaQueryWrapper<Media> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Media::getMessageId, messageId);
        return mediaMapper.selectList(queryWrapper);
    }

    @Override
    public void addMedia(Media media) {
        mediaMapper.insert(media);
    }

}
